package basic;

import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jfinal.handler.Handler;

public class AllHandler extends Handler {

	String regx;
	Pattern skip;
	public AllHandler(String regx){
		this.regx=regx;
	}

	@Override
	public void handle(String target, HttpServletRequest request,
			HttpServletResponse response, boolean[] arg) {
			skip=Pattern.compile(regx);
			if(skip.matcher(target).matches()){
				arg[0]=true;
				return;
			}
			else{
				nextHandler.handle(target, request, response, arg);
			}
	}

}
